package com.example.mybatisplus.config;

import com.baomidou.mybatisplus.core.incrementer.IdentifierGenerator;
import org.springframework.stereotype.Component;

import java.util.concurrent.atomic.AtomicLong;

@Component
public class CustomerIdGenerator implements IdentifierGenerator {
    /**
     *  配置自定义ASSIN_ID
     */

    @Override
    public Long nextId(Object entity) {
        // 填充自己的Id生成器，

        return IdGenerator.generateId();
    }

    /**
     * 配置自定UUID
     * @param entity
     * @return
     */
    @Override
    public String nextUUID(Object entity) {
        return IdGenerator.uuid();
    }
}